﻿@using SchoolPointe.RelatedContent.Helpers 
@using SchoolPointe.RelatedContent.Extensions

@model SchoolPointe.RelatedContent.Models.RelatedContentRelationship
      
<fieldset>
    <div style="float:left; width:90%;">
        @Html.HiddenIndexerInputForModel()        
        @Html.HiddenFor(m => m.Identifier)

        @* {SomeContentType} {has many} {item(s)} and this relationship {is required} *@
        @ViewBag.ParentTypeName 
        @Html.DropDownListFor(m => m.RelationType, Model.RelationType.ToSelectList())            
        @Html.EditorFor(m => m.ContentTypeLimitations, "ContentTypeLimitations")  
        and this relationship
        @(Html.DropDownListFor(m => m.IsRequired, new SelectList(new [] {
            new SelectListItem { Text = "is required", Value = bool.TrueString }, 
            new SelectListItem { Text = "is optional", Value = bool.FalseString }, 
        }, "Value", "Text", Model.IsRequired))). This relationship is named 

        @Html.TextBoxFor(m => m.Name) .
  
        @Html.ValidationMessageFor(m => m.Name)                          
        @Html.ValidationMessageFor(m => m.RelationType)  
        @Html.ValidationMessageFor(m => m.IsRequired)         
        @Html.ValidationMessageFor(m => m.ContentTypeLimitations)  
    </div>
    <div style="float:right; width:10%; text-align:right;">
        <a class="remove-content-relationship" href="#">Remove</a>        
    </div>
    <br style="clear:both;" />
    <a class="advanced-content-relationship-toggle" href="#">Show Advanced Settings</a>
    <div class="advanced-content-relationship-settings" style="display:none;">
        @Html.LabelFor(m => m.EditorView)
        @Html.TextBoxFor(m => m.EditorView, new { style = "width:300px;" })

        @Html.LabelFor(m => m.InverseOf)
        @Html.TextBoxFor(m => m.InverseOf, new { Style = "width:300px;" })
    </div>
</fieldset>